package controllers

import play.api.mvc.{AbstractController, ControllerComponents}
import play.api.routing.JavaScriptReverseRouter

import javax.inject.Inject

/**
 * Created by yz on 11/5/2020
 */
class AppController @Inject()(cc: ControllerComponents) extends  AbstractController(cc){

  def toIndex = Action { implicit request =>
    Ok(views.html.index())
  }



  def javascriptRoutes = Action { implicit request =>
    Ok(
      JavaScriptReverseRouter("jsRoutes")(

        controllers.routes.javascript.BrowseController.getAllProkaryote,
        controllers.routes.javascript.BrowseController.detailInfoBefore,
        controllers.routes.javascript.BrowseController.getBioSampleById,
        controllers.routes.javascript.BrowseController.getMummerFileData,
        controllers.routes.javascript.BrowseController.getAssemblyById,

        controllers.routes.javascript.TreeController.getNwk,

        controllers.routes.javascript.MapController.getCountryInfo,
        controllers.routes.javascript.MapController.getProkaryoteByCountry,

        controllers.routes.javascript.MutantController.getAllSnpByServer,
        controllers.routes.javascript.MutantController.getCdsSnpByServer,
        controllers.routes.javascript.MutantController.getCdsInDelByServer,
        controllers.routes.javascript.MutantController.getInterInDelByServer,

        controllers.routes.javascript.ToolController.geoPredict,

      )
    ).as("text/javascript")
  }


}
